//
//  HYC_AFN.h
//  HYC_TOOLS_OC
//
//  Created by 金日集团 on 2024/4/18.
//

#import <Foundation/Foundation.h>

 

@interface HYC_AFN : NSObject

 

typedef NS_ENUM(NSInteger, NetworkReachabilityStatus) {

    NetworkReachabilityStatusUnknown   = -1,

    NetworkReachabilityStatusNotReachable  = 0,

    NetworkReachabilityStatusReachableViaWWAN = 1,

    NetworkReachabilityStatusReachableViaWiFi = 2,

};

 

// GET请求

+ (void)getWithURLString:(NSString *)URLString

parameters:(id)parameters

                 success:(void (^)(id responseObject))success

                 failure:(void (^)(NSError * error))failure;

 

// POST请求

+ (void)postWithURLString:(NSString *)URLString

               parameters:(id)parameters

                  success:(void (^)(id responseObject))success

                  failure:(void (^)(NSError * error))failure;

// 上传图片

+ (void)uploadWithURLString:(NSString *)URLString

                 parameters:(id)parameters

                 uploadData:(NSData *)uploadData

                 uploadName:(NSString *)uploadName

                    success:(void (^)(id responseObject))success

                    failure:(void (^)(NSError *error))failure;

// 上传多张图片

+ (void)uploadMostImageWithURLString:(NSString *)URLString

                          parameters:(id)parameters

                         uploadDatas:(NSArray *)uploadDatas

                          uploadName:(NSString *)uploadName

                             success:(void (^)(id responseObject))success

                             failure:(void (^)(NSError *error))failure;

// 下载

+(void)DownLoadWithUrlString:(NSString *)URLString

                  parameters:(id)parameters

                    progress:(void (^)(id))progress

                     success:(void(^)(NSURL *filePath))success;

 

// 检测网络

+(void)setReachabilityStatusChangeBlock:(void(^)(NetworkReachabilityStatus status))block;

+(void)stopMonitoring;

 

 

 

@end
